package com.webdesign.util;

import java.util.ArrayList;
import java.util.List;

public  class ReturnTerm {
	/*
	 * 在新建学年页面，返回列表可选的几个学年名
	 */
	public static List<String> termNames(String termname){
		List<String> terms = new ArrayList<String>();
		terms.add(termname);
		String str[] = termname.split("/");
		int first = Integer.parseInt(str[0]);
		if(str[1].contains("上")){
			terms.add(String.valueOf(first) + "/" + String.valueOf(first+1) + "（下）");
			terms.add(String.valueOf(first+1) + "/" + String.valueOf(first+2)+"（上）");
			terms.add(String.valueOf(first+1) + "/" + String.valueOf(first+2)+"（下）");
			terms.add(String.valueOf(first+2) + "/" + String.valueOf(first+3)+"（上）");
		}else{
			terms.add(String.valueOf(first+1) + "/" + String.valueOf(first+2)+"（上）");
			terms.add(String.valueOf(first+1) + "/" + String.valueOf(first+2)+"（下）");
			terms.add(String.valueOf(first+2) + "/" + String.valueOf(first+3)+"（上）");
			terms.add(String.valueOf(first+2) + "/" + String.valueOf(first+3)+"（下）");
		}
		return terms;
	}
}	
